<!DOCTYPE html>
<html>
  <head>
  <title></title>
  
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
	<meta charset="utf-8">
	
	<!-- If your application is targeting iOS BEFORE 4.0 you MUST put json2.js from http://www.JSON.org/json2.js into your www directory and include it here -->
	<script type="text/javascript" charset="utf-8" src="cordova-1.6.0.js"></script>
        
    <script type="text/javascript" charset="utf-8" src="HelloPlugin.js"></script>
    <script type="text/javascript">

	
	function onBodyLoad()
	{		
		document.addEventListener("deviceready", onDeviceReady, false);
	}
	
	/* When this function is called, Cordova has been initialized and is ready to roll */
	/* If you are supporting your own protocol, the var invokeString will contain any arguments to the app launch.
	see http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
	for more details -jm */
	function onDeviceReady()
	{
		// do your thing!
		navigator.notification.alert("Cordova is working")
	}
        
    function callNativePlugin( returnSuccess ) {
        HelloPlugin.callNativeFunction( nativePluginResultHandler, nativePluginErrorHandler, returnSuccess );
    }
                                       
    function nativePluginResultHandler (result) {
       alert("SUCCESS: \r\n"+result );
    }

    function nativePluginErrorHandler (error) {
       alert("ERROR: \r\n"+error );
    }
        
        
    
    </script>
    </head>
	<body onload="onBodyLoad()">
		<h1>Hey, it's Cordova!</h1>
	      
		<button onclick="callNativePlugin('success');">Click to invoke the Native Plugin with an SUCCESS!</button>
		<button onclick="callNativePlugin('error');">Click to invoke the Native Plugin with an ERROR!</button>
	</body>
</html>
